#include <iostream>
#include <string>
using namespace std;

int main() {
    string s1;
    getline(cin, s1);
    string::reverse_iterator it = s1.rbegin();
    int n = 0;
    while (*it != ' ')
    {
        ++it;
        ++n;
    }
    cout << n;
    return 0;
}